1. Field of the Invention
This invention relates to capturing a digital image. In a preferred form, the invention relates to a digital camera and to a method of operation.
The invention is especially suitable for use with, or for inclusion in, so-called document cameras for capturing digital images of documents, for example, for storage, or for processing by optical character recognition (OCR). However, the invention is not limited only to such a field, and may find application for use with, or for inclusion in, general digital-photography cameras.
The invention is also especially suitable for use with, or for inclusion in, handheld cameras, but it is not limited exclusively to such cameras.
2. Description of Related Art
Many designs of camera for capturing a digital image of a document are known, including hand-held cameras.
However, when using a hand-held document camera, the camera will often be held at an oblique angle relative to the document (in other words, it is often impractical to hold the document camera in a plane parallel to the plane of the document). In such a case, the captured document image can suffer from distortion including perspective distortion, and from out of focus blur. Although perspective distortion may be corrected by dewarping techniques, this can lead to low-resolution and poor image quality. In addition, out-of-focus blur may be present in parts of the image due to the oblique angle.
An example of such problems in a captured image is illustrated in FIGS. 1, 2 and 3. FIG. 1 depicts a camera operator 10 holding a camera 12 at an oblique angle to capture an image of a document 14.
FIG. 2 shows a typical captured document image 16 in such a case. It is immediately evident that the captured image suffers from perspective distortion. The edges of the text columns are not “vertical” (i.e. perpendicular to the text lines); the text appears compressed in a horizontal direction and the text varies in size from top to bottom of the image; and individual letters incline towards the edges of the image.
Dewarping techniques are known for geometrically transforming an image to correct the perspective distortion. For example, the image may be dewarped by expanding the horizontal image width progressively from bottom to top, and also by expanding the image vertically to correct the horizontal compression.
FIG. 3 shows the result of such a dewarping technique applied to the image of FIG. 2. Although the perspective is restored, the image contains poor quality regions 18 and 20 which suffer from out-of-focus blur. The upper region 18 of the document is too distant from the camera to be focused correctly, and the lower region 20 of the document is too close to the camera to be focused correctly. Only the central region 22 of the image is of clear quality. Additionally, the resolution of the upper (distant) portion 18 is very low as a result of the perspective distortion (which causes distant portions to appear smaller, and hence have a reduced resolution).
The above problem is not limited to document cameras. There are many situations in which it is impossible to capture an image in which an object is in focus throughout the image. For example, the object may be too large to be focused correctly. Additionally, it is often impossible to capture both a foreground and background together in focus.
Although not relevant to the present field, reference may be made to the bar-code readers described in U.S. Pat. Nos. 5,798,516 and 5,386,107. These documents describe arrangements for reading barcodes at unknown distance ranges. However, these documents do not address the problem of achieving a completely blur free image of an object at an oblique angle which may never be in perfect focus.